﻿namespace Acme.Marketing.Data
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    /// <summary>
    ///     Represents the advertisement placed in the newspaper.
    /// </summary>
    public class Advertisement
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="Advertisement" /> class.
        /// </summary>
        public Advertisement()
        {
            Newspapers = new List<Newspaper>();
            ExternalGuid = Guid.NewGuid();
        }

        /// <summary>
        ///     Gets or sets the advertisement identifier.
        /// </summary>
        /// <value>
        ///     The advertisement identifier.
        /// </value>
        public long AdvertisementId { get; set; }

        /// <summary>
        ///     Gets or sets the external unique identifier used for integration across vendors.
        /// </summary>
        /// <value>
        ///     The external unique identifier.
        /// </value>
        public Guid ExternalGuid { get; set; }

        /// <summary>
        ///     Gets or sets the headline.
        /// </summary>
        /// <value>
        ///     The headline.
        /// </value>
        public string Headline { get; set; }

        /// <summary>
        ///     Gets or sets the markup contents of advertisement.
        /// </summary>
        /// <value>
        ///     The marked up contents.
        /// </value>
        [DataType(DataType.MultilineText)]
        public string Contents { get; set; }

        /// <summary>
        ///     Gets or sets the width of the advertisement piece in pixels.
        /// </summary>
        /// <value>
        ///     The width of the advertisement in the printed newspaper.
        /// </value>
        public int PixelWidth { get; set; }

        /// <summary>
        ///     Gets or sets the height of the advertisement piece in pixels.
        /// </summary>
        /// <value>
        ///     The height of the advertisement in the printed newspaper.
        /// </value>
        public int PixelHeight { get; set; }

        /// <summary>
        ///     Gets or sets the cost of the advertisement
        /// </summary>
        /// <value>
        ///     The cost of the advertisement in USD.
        /// </value>
        public decimal Cost { get; set; }

        /// <summary>
        ///     Gets or sets the collection of newspapers this advertisement is listed in.
        /// </summary>
        /// <value>
        ///     The newspapers that contain this advertisement.
        /// </value>
        public virtual ICollection<Newspaper> Newspapers { get; set; }
    }
}